package com.zjb.demo.common.config;

import com.github.xiaoymin.knife4j.solon.extension.OpenApiExtensionResolver;
import io.swagger.models.Scheme;
import org.noear.solon.annotation.Bean;
import org.noear.solon.annotation.Configuration;
import org.noear.solon.annotation.Inject;
import org.noear.solon.docs.DocDocket;

/**
 * @author 庄佳彬
 * @since 2023/12/25 15:28
 */
@Configuration
public class DocConfig {
    @Inject
    private OpenApiExtensionResolver resolver;

    @Bean("appApi")
    public DocDocket appApi() {
        return new DocDocket()
                .basicAuth(resolver.getSetting().getBasic())
                .vendorExtensions(resolver.buildExtensions())
                .groupName("接口")
                .schemes(Scheme.HTTP.toValue())
                .apis("com.zjb.demo");
    }
}
